package com.leyou.item.mapper;

import com.leyou.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;

/**
 * @author XiaoLuo
 * @ClassName: CategoryMapper
 * @Description: ${todo}
 * @date 2019/4/13 16:24
 */
public interface CategoryMapper extends Mapper<Category> ,
		SelectByIdListMapper<Category,Long> {
	/**
	 * 根据品牌ID查询对应商品分类对象
	 * @param
	 * @return
	 */
	@Select("select tc.* from tb_category tc inner join tb_category_brand cb on tc.id=cb.category_id where cb.brand_id = #{bid}")
	List<Category> queryByBrandId(@Param("bid") Long bid);

	/**
	 * 查询三级分类
	 * mapper的selectByIDList方法是来自于通用mapper。
	 * 不过需要我们在mapper上继承一个通用mapper接口：
	 * SelectByIdListMapper<Category, Long>
	 * @param ids
	 * @return
	 */

}
